A magnetic field sensor measuring a bearing using magneto-resistance elements is disclosed in Patent Document 1. The magnetic field sensor is composed of an almost square plane coil formed on a plane substrate and four pairs of magneto-resistance elements crossing sides of the coil at a predetermined angle. By feeding a DC current to the plane coil, a reset magnetic field that magnetically saturates the magneto-resistance elements to a sufficient level and an appropriate magnetic field (biasing magnetic field) required upon measurement can be applied. In this case, the same amount of the reset or biasing magnetic field can be simultaneously applied in four directions: X direction; −X direction; Y direction; and −Y direction.
Patent Document 2 discloses two plane coils formed on plane substrates and a magnetic field sensing structure (which is a resistance bridge made of barber-pole type magneto-resistance elements in this case). A DC current is fed to a first plane coil to apply a reset magnetic field that magnetically saturates the barber-pole type magneto-resistance elements, while a DC current is being fed to a second plane coil to apply a magnetic field to cancel an external magnetic field to the barber-pole type magneto-resistance elements.    Patent Document 1: Japanese Patent 3,573,100 to which U.S. Pat. No. 6,556,007 issued Apr. 29, 2003 corresponds.    Patent Document 2: Published Japanese Translation 2005-502888 of a PCT application to which U.S. Pat. No. 6,717,403 issued Apr. 6, 2004 corresponds.
In determination of a bearing based on geo-magnetism measured by a magnetic field sensor, external magnetic fields other than the geo-magnetism are a cause of bearing errors. Detection of the bearing is made by measuring the geo-magnetism with two one-axis magnetic field sensors combined at a right angle with each other or a magnetic field sensor having two or more axes, calculating an angle between the reference direction of the magnetic field sensor and a vector of the geo-magnetism from the ratio between the measured values of each axis, and outputting the calculated angle as a bearing angle. If there are external magnetic fields other than the geo-magnetism upon the detection, the magnetic field measured by the magnetic field sensor results in a compound magnetic field of the geo-magnetism and the external magnetic fields, which means that the calculated angle is not an accurate bearing angle. Since the calculated bearing is offset from the actual bearing, the external magnetic field that causes the offset is referred to as an external offset magnetic field. Hereinafter, the term “external offset magnetic field” is used, unless otherwise specified.
Magnetic fields steadily or constantly existing in iron bridges, iron towers, ferro-concrete buildings and so on irrespective to the state of a magnetic field sensor appear to be external offset magnetic fields, however, these external magnetic fields are already included in a measured geo-magnetism, and therefore are not referred to as external offset magnetic fields. However, it is impossible to eliminate the influence of the external magnetic fields.
External offset magnetic fields are what are applied to a magnetic field sensor in the constant direction and at the constant intensity. For example, the external offset magnetic fields are caused by magnetic components on an electric circuit board on which the magnetic field sensor is installed, by a car body in which the magnetic field sensor is installed and so on. The influence of the external offset magnetic fields can be eliminated or reduced in a way.
Eliminating or reducing the influence of the external offset magnetic fields can be accomplished by measuring the external offset magnetic fields applied to the magnetic field sensor in advance and subtracting components of the external offset magnetic fields ahead of calculation of the ratio between measured magnetic field values of each axis. Another method includes applying a magnetic field for canceling the external offset magnetic fields around the magneto-resistance elements to eliminate the external offset magnetic fields.